package com.itheima.health.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.service.MenuService;
import com.itheima.health.vo.MenuVO;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("menu")
public class MenuController {

    @Reference
    private MenuService menuService;


    @GetMapping("getUsername/{username}")
    public Result getUsername(@PathVariable("username") String username){
        List<MenuVO> menuVOList = menuService.getUsername(username);
        return new Result(menuVOList);
    }
}
